package cn.fxyz.dao.impl;

import java.util.List;

import cn.fxyz.base.impl.BaseDaoImpl;
import cn.fxyz.dao.FoodtypeDao;
import cn.fxyz.entity.Foodtype;

public class FoodtypeDaoImpl extends BaseDaoImpl<Foodtype> implements FoodtypeDao{
	
	public List<Foodtype> selectByFoodname(Foodtype foodtype){
		return (List<Foodtype>) this.getHibernateTemplate().find("from Foodtype where typename=?", foodtype.getTypename());
		
	}

	public Foodtype selectByName(String typename) {
		List<Foodtype> find = (List<Foodtype>) this.getHibernateTemplate().find("from Foodtype where typename=?", typename);
		if(find != null && find.size() > 0) {
			return find.get(0);
		}
		return null;
	}
}
